
//require('debug.js');

include('base.js');
include('browser.js');
include('select.js');
include('./marquee.js');
include('./slides.js');
var sound = require('sound.js');

// some elements are labeled "superfluous" if they should not appear
// until we know JavaScript works.
select('.superfluous').
forEach(removeClass('superfluous'));

// start the slide show of features in B:C
select('#features').forEach(Slides);

// start the slideshow of samples in A2
select('#samples').forEach(function (samples) {
    Slides(samples);
    observe(samples, 'click', function () {
        document.location.href = 'samples.html';
        this.stop();
    });
});

// start the API reference scrolling marquee in A3
select('#reference').forEach(VerticalMarquee);

// add sounds to link mouseovers
sound.ready.observe(function () {
    var bonk = sound.Sound('bonk.mp3');
    select('a').forEach(function (plaque) {
        observe(plaque, 'mouseover', function () {
            bonk.play();
        });
    });
});

// add a link to pop up a debug console
var learn = select('#learn').get(0);
var link = tag('a', {'href': 'build/run.html'}, ['Console Demo']);
observe(link, 'click', function () {
    var debug = require('debug.js');
    debug.ready.observe(function () {
        info('try the dir() command.  compare to dir(window).  try the log("hello") command.');
        debug.toggleVisible();
    });
    this.stop();
});
learn.appendChild(tag('li', {}, [link]));

